﻿using Avalonia.Controls;
using Avalonia.Interactivity;
using DevHub.WindowsApp.ViewModels.Pages;
using DevHub.WindowsApp.Views;

namespace DevHub.WindowsApp.Pages;

public partial class HomeView : UserControl
{
    public HomeView()
    {
        InitializeComponent();
    }
    

    private void SelectionClick(object? sender, RoutedEventArgs e)
    {
        if(sender is not Control control)return;
        if(control.DataContext is not PageRecord pageRecord)return;
        var main = ViewServes.GetView<MainWindow>(this);
        main?.Navigate(pageRecord.PageTag);
    }
}